using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Decav.Gatsb.Web;
using Decav.Gatsb.Configuration;
using Decav.Gatsb.Application;
using System.Net.Mail;
using Decav.Security;
using Decav.Gatsb;
using Decav.Gatsb.Data;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack && GatsbWebApplication.Current.UserPresent)
        {
            if (User.Identity.IsAuthenticated)
                Response.Redirect(GatsbConfigurationSection.Current.AuthenticatedUserDefaultPage, true);

            FormsAuthentication.SignOut();
        }

        ((IMasterPageTemplate)Master).SelectedPage = MainMenuNavigationButton.Home;

        Decav.Gatsb.Post[] posts = null;
        using (IGatsbDataAdapter adapt = GatsbApplication.Current.GetDataAdapter())
            posts = adapt.GetLatestPosts(false,false, 8);

        locationRepeater.DataSource = posts;
        locationRepeater.DataBind();
    }
}
